import axios from "axios";
export default function({ $axios, redirect }) {
    $axios.onRequest(config => {
        // console.log(window.alert(55));
        console.log('start--api：' + config.url)
        config.headers.token = "test--token";
    })

    $axios.onError(error => {
        const code = parseInt(error.response && error.response.status)
        if (code === 400) {
            redirect('/400')
        }
    })
}